import request from '@/utils/request'

/**
 * 获取二手商城列表
 * @returns
 */
export function getEsGoodsList(params : Record<string, any>) {
	return request.get(`ershou/list`, params)
}
/**
 * 获取商品详情
 */
export function getGoodsDetail(params: Record<string, any>) {
	return request.get(`ershou/detail`, params)
}
/**
 * 订单创建计算
 */
export function orderCreateCalculate(params: Record<string, any>) {
	return request.get('ershou/calculate', params)
}

/**
 * 订单创建
 */
export function orderCreate(params: Record<string, any>) {
	return request.post('ershou/create', params)
}

/**
 * 获取我的二手商城列表
 * @returns
 */
export function getMyEsGoodsList(params : Record<string, any>) {
	return request.get(`ershou/my_list`, params)
}

/**
 * 提交二手商品申请
 */
export function myGoodsApply(params: Record<string, any>) {
	return request.post('ershou/my_goods_apply', params, {showSuccessMessage: true})
}

/**
 * 获得二手商品详情
 */
export function myGoodsInfo(params: Record<string, any>) {
	return request.post('ershou/my_goods_info', params)
}

/**
 * 改变二手商品上下架状态
 */
export function myGoodsStatus(params: Record<string, any>) {
	return request.post('ershou/my_goods_status', params)
}

/**
 * 改变我的订单
 */
export function myOrderlist(params: Record<string, any>) {
	return request.post('ershou/my_order_list', params)
}

/**
 * 改变我的二手产品订单
 */
export function myGoodsOrderList(params: Record<string, any>) {
	return request.post('ershou/my_goods_order_list', params)
}

/**
 * 我的二手产品发货
 */
export function myGoodsOrderFahuo(params: Record<string, any>) {
	return request.post('ershou/my_goods_order_fahuo', params)
}

/**
 * 快递公司
 */
export function expressCompanyList(params: Record<string, any>) {
	return request.post('ershou/express_company_list', params)
}
/**
 * 获取商品列表供组件调用
 */
export function getErshouComponents(params: Record<string, any>) {
	return request.get(`ershou/components`, params)
}